home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / perl / ctype.ph < prev    next >
Text File  |  1991-08-11  |  2KB  |  65 lines

  1. if (!defined &_CTYPE) {
  2.     eval 'sub _CTYPE {1;}';
  3.     require 'cfuncproto.ph';
  4.     if (!defined &EOF) {
  5.     eval 'sub EOF {(-1);}';
  6.     }
  7.     eval 'sub isalnum {
  8.         local($char) = @_;
  9.         eval "(( &_ctype_bits+1)[$char] & ( &CTYPE_UPPER| &CTYPE_LOWER| &CTYPE_DIGIT))";
  10.     }';
  11.     eval 'sub isalpha {
  12.         local($char) = @_;
  13.         eval "(( &_ctype_bits+1)[$char] & ( &CTYPE_UPPER| &CTYPE_LOWER))";
  14.     }';
  15.     eval 'sub iscntrl {
  16.         local($char) = @_;
  17.         eval "(( &_ctype_bits+1)[$char] &  &CTYPE_CONTROL)";
  18.     }';
  19.     eval 'sub isdigit {
  20.         local($char) = @_;
  21.         eval "(( &_ctype_bits+1)[$char] &  &CTYPE_DIGIT)";
  22.     }';
  23.     eval 'sub isgraph {
  24.         local($char) = @_;
  25.         eval "(( &_ctype_bits+1)[$char] & ( &CTYPE_UPPER| &CTYPE_LOWER| &CTYPE_DIGIT| &CTYPE_PUNCT))";
  26.     }';
  27.     eval 'sub islower {
  28.         local($char) = @_;
  29.         eval "(( &_ctype_bits+1)[$char] &  &CTYPE_LOWER)";
  30.     }';
  31.     eval 'sub isprint {
  32.         local($char) = @_;
  33.         eval "(( &_ctype_bits+1)[$char] &  &CTYPE_PRINT)";
  34.     }';
  35.     eval 'sub ispunct {
  36.         local($char) = @_;
  37.         eval "(( &_ctype_bits+1)[$char] &  &CTYPE_PUNCT)";
  38.     }';
  39.     eval 'sub isspace {
  40.         local($char) = @_;
  41.         eval "(( &_ctype_bits+1)[$char] &  &CTYPE_SPACE)";
  42.     }';
  43.     eval 'sub isupper {
  44.         local($char) = @_;
  45.         eval "(( &_ctype_bits+1)[$char] &  &CTYPE_UPPER)";
  46.     }';
  47.     eval 'sub isxdigit {
  48.         local($char) = @_;
  49.         eval "(( &_ctype_bits+1)[$char] & ( &CTYPE_DIGIT| &CTYPE_HEX_DIGIT))";
  50.     }';
  51.     eval 'sub isascii {
  52.         local($i) = @_;
  53.         eval "(($i & ~0x7f) == 0)";
  54.     }';
  55.     eval 'sub CTYPE_UPPER {0x01;}';
  56.     eval 'sub CTYPE_LOWER {0x02;}';
  57.     eval 'sub CTYPE_DIGIT {0x04;}';
  58.     eval 'sub CTYPE_SPACE {0x08;}';
  59.     eval 'sub CTYPE_PUNCT {0x10;}';
  60.     eval 'sub CTYPE_PRINT {0x20;}';
  61.     eval 'sub CTYPE_CONTROL {0x40;}';
  62.     eval 'sub CTYPE_HEX_DIGIT {0x80;}';
  63. }
  64. 1;
  65.